﻿@{
    ViewBag.Title = "实时负荷曲线图";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
@section scripts{
    <script src="~/Areas/Pacm/ViewModels/Pacm.com.js"></script>
    <script src="~/Areas/Pacm/ViewModels/Pacm.viewModel.chart.js"></script>
    <script src="~/Content/js/Charts/FusionCharts.js"></script>
    <script type="text/javascript">
            var data = @Html.Raw(Newtonsoft.Json.JsonConvert.SerializeObject(Model));
            var viewModel = function(){ 
                Pacm.viewModel.chart.apply(this,arguments);
//                this.refreshClick= function(){
//                    var Mc = encodeURI(this.form.AI名称());
//                    var Rq = this.form.日期();
//                    $.ajax({
//                    type: 'POST',
//                    url: "/Pacm/Scsj/GetChartAiZoomLine",
//                    data: "{sName:'" + Mc + "',sRq:'" + Rq + "'}", 
//                    contentType: "application/json; charset=utf-8",     
//                    datatype: "json",
//                    success: function (response) {
//                        var val = response;
//                        var chart = new FusionCharts("../../../../Content/js/Charts/ZoomLine.swf", "ChartId", "100%", "100%", "0", "1", "FFFFFF", "exactFit");
//                        chart.setDataXML(val);
//                        chart.render("chartdiv");
//                   }});
//                  };
            };
            ko.bindingViewModel(new viewModel(data));
            $(window).load(function () {
                //动态改变高度
                var iHeight = $(this).height() - 95;
                document.getElementById("chartdiv").style.height = iHeight + "px";
            });
            $(window).resize(function () {
                var iHeight = $(this).height() - 95;
                document.getElementById("chartdiv").style.height = iHeight + "px";
            });
    </script>
}
@*<div class="z-toolbar">
    <a id="a_refresh" href="#" plain="true" class="easyui-linkbutton" icon="icon-arrow_refresh"
        title="刷新" data-bind="click:refreshClick">刷新</a>
</div>*@
<div id="condition" class="container_12" style="height: 34px; padding-top: 5px;">
    <div class="grid_1 lbl">电表名称</div>
    <div class="grid_4 val"><input type="text" style="width:300px;"   data-bind="comboboxValue:form.AI名称,datasource:dataSource.dbzdItems" class="easyui-combobox z-txt" data-options="showblank:true" /></div>
    <div class="clear"></div>
    <div class="grid_1 lbl">查询日期</div>
    <div class="grid_2 val"><input type="text" data-bind="dateboxValue:form.日期"   class="z-txt easyui-datebox"/></div>
   <div class="prefix_6" style="position:absolute;top:5px;height:0;">  
        <a id="a_search" href="#" class="button button-blue" data-bind="click:searchClick">查询</a>
       @* <a id="a_reset" href="#" class="button button-blue" data-bind="click:clearClick">清空</a>*@
    </div>
</div>
 <div class="easyui-tabs" style="margin-top:25px" data-options="fit:true,border:false">
    <div title = "曲线图"  align="center">
        <div id="chartdiv"></div>
    </div>
</div> 
